# -*- cperl -*-
{
    my $expect = <<____END_EXPECT;
ok, trick1
ok, trick2
ok, trick3
ok, [trick1 trick2 trick3], [trick1 trick2 trick3], []
ok, you 'trick' me, trick...
ok, foo => echo; first: echo
ok, a, trick2
ok, c, trick2
ok, d, trick2
ok, baz => a c d; first: a
ok, bar => baz; first: baz
ok, foobar => foo bar; first: foo
==========
ok, trick1
ok, trick2
ok, trick3
ok, [trick1 trick2 trick3], [trick1 trick2 trick3], []
ok, you 'trick' me, trick...
ok, foo => echo; first: echo
ok, a, trick2
ok, c, trick2
ok, d, trick2
ok, baz => a c d; first: a
ok, bar => baz; first: baz
ok, foobar => foo bar; first: foo
==========
ok, trick1
ok, trick3
ok, [trick1 trick2 trick3], [trick1 trick2 trick3], []
ok, you 'trick' me, trick...
ok, foo => echo; first: echo
ok, a, trick2
ok, c, trick2
ok, d, trick2
ok, baz => a c d; first: a
ok, bar => baz; first: baz
ok, foobar => foo bar; first: foo
==========
ok, trick1
ok, trick3
ok, [trick1 trick2 trick3], [trick1 trick2 trick3], []
ok, you 'trick' me, trick...
ok, foo => echo; first: echo
ok, c, trick2
ok, d, trick2
ok, baz => a c d; first: a
ok, bar => baz; first: baz
ok, foobar => foo bar; first: foo
==========
ok, trick1
ok, trick3
ok, [trick1 trick2 trick3], [trick1 trick2 trick3], []
ok, you 'trick' me, trick...
ok, foo => echo; first: echo
ok, c, trick2
ok, baz => a c d; first: a
ok, bar => baz; first: baz
ok, foobar => foo bar; first: foo
==========
ok, trick1
ok, trick3
ok, [trick1 trick2 trick3], [trick1 trick2 trick3], []
ok, you 'trick' me, trick...
ok, foo => echo; first: echo
ok, a, trick2
ok, c, trick2
ok, d, trick2
ok, baz => a c d; first: a
ok, bar => baz; first: baz
ok, foobar => foo bar; first: foo
==========
ok, trick1
ok, trick3
ok, [trick1 trick2 trick3], [trick1 trick2 trick3], []
ok, you 'trick' me, trick...
ok, foo => echo; first: echo
ok, baz => a c d; first: a
ok, bar => baz; first: baz
ok, foobar => foo bar; first: foo
===========
____END_EXPECT
    ;
    my @r;
    do { push @r, $_ if !m/^smart:.+$/ } for @result;
    my $result = join '', @r;
    $check_result = $result eq $expect;
    $_ = "$file.log";
    unlink if -f;
    do {
        open F, ">$file.log" or die "$!";
        print F "==================== expecting ==\n";
        print F $expect;
        print F "\n";
        print F "==================== received ===\n";
        print F $result;
        close F;
    } unless $check_result;
    print "";
}

